<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ExpectX统一认证中心</title>
    <link rel="shortcut icon" href="<%=basePath%>resources/images/icon.png" type="image/x-icon" />
    <style>
        /*css 初始化 */
        html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img {
            margin: 0;
            padding: 0;
        }

        /*将标签原有的默认内外边距去掉*/

        fieldset, img, input, button {
            border: none; /*去掉边框*/
            padding: 0;
            margin: 0;
            outline-style: none; /*去掉环绕边框*/
        }

        ul, ol {
            list-style: none; /*去掉原样式中的小黑点*/
        }

        input {
            padding-top: 0;
            padding-bottom: 0;

        }

        select, input {
            vertical-align: middle; /*输入字居中显示*/
        }

        select, input, textarea {
            font-size: 14px;
            margin: 0;
        }

        textarea {
            resize: none; /*防止拖动*/
        }

        img {
            border: 0;
            vertical-align: middle; /*  去掉图片底部默认的3像素空白缝隙*/
        }

        table {
            border-collapse: collapse; /*合并外边线*/
        }

        body {
            font-family:  Microsoft YaHei, Arial, "\5b8b\4f53";
            background: #379fd4;
        }

        .clearfix:before, .clearfix:after {
            content: "";
            display: table;
        }

        .clearfix:after {
            clear: both;
        }

        .clearfix {
            *zoom: 1; /*IE/7/6*/
            /*兼容IE6下的写法*/
        }

        h1, h2, h3, h4, h5, h6 {
            text-decoration: none; /**/
            font-weight: normal; /*不加粗*/
            font-size: 100%;
        }

        /*login 开始*/
        .login{
            width: 1000px;
            height: 500px;
            /*background-color: yellowgreen;*/
            position: absolute;
            left:50%;
            top:50%;
            margin-left: -500px;
            margin-top: -250px;
        }
        .login>.login_title{
            height: 80px;
            text-align: center;
        }
        .login>.login_title>p{
            color:#fff;
            font-size: 40px;
            font-weight: 600;
            margin-top: -8px;
            letter-spacing:5px
        }
        .login>.login_main{
            width: 1000px;
            height: 320px;
        }
        .login>.login_main>.main_left{
            height: 320px;
            width: 600px;
            float: left;
            -moz-border-top-left-radius: 10px;
            -webkit-border-top-left-radius: 10px;
            border-top-left-radius: 10px;

            -moz-border-bottom-left-radius: 10px;
            -webkit-border-bottom-left-radius: 10px;
            border-bottom-left-radius: 10px;

            background: url("<%=basePath%>resources/images/login_left.png") no-repeat;
        }
        .login>.login_main>.main_right{
            height: 320px;
            width: 400px;
            float: right;
            background-color: #e9eef2;
            -moz-border-top-right-radius: 10px;
            -webkit-border-top-right-radius: 10px;
            border-top-right-radius: 10px;

            -moz-border-bottom-right-radius: 10px;
            -webkit-border-bottom-right-radius: 10px;
            border-bottom-right-radius: 10px;
        }
        .login>.login_main>.main_right>.right_title{
            color:#379fd4;
            font-size: 20px;
            font-weight: 700;
            text-align: center;
            line-height: 60px;
            margin-bottom: 10px;
        }
        .login>.login_main>.main_right>form>div{
            position: relative;
        }
        .login>.login_main>.main_right>form>div>img{
            position: absolute;
            left: 62px;
            top:7px;
        }
        .login>.login_main>.main_right>form input{
            height: 35px;
            width: 300px;
            border: 1px solid #d3d8dc;
            box-sizing: border-box;
            margin-bottom: 20px;
            margin-left: 50px;
            -moz-border-radius: 3px;
            -webkit-border-radius: 3px;
            border-radius: 3px;
            color:#333;
            padding-left: 40px;
        }

        .login>.login_main>.main_right>form>.code>input{
            width: 160px;
        }
        .login>.login_main>.main_right>form>.code>.code_img{
            width: 130px;
            height: 35px;
            float: right;
            margin-right: 50px;
            cursor: pointer;
            text-align: right;
        }
        .login>.login_main>.main_right>form input:focus{
            border: 1px solid #999;
        }
        .login>.login_main>.main_right>form>.yes_login>a{
            display: block;
            width: 300px;
            height: 35px;
            line-height: 35px;
            text-align: center;
            background-color: #379fd4;
            -moz-border-radius: 3px;
            -webkit-border-radius: 3px;
            border-radius: 3px;
            color:#fff;
            text-decoration: none;
            margin-left: 50px;
        }
        .login>.login_footer{
            text-align: center;
            padding-top: 20px;
        }
        .login>.login_footer>p{
            font-size: 14px;
            color:#eee;
            line-height: 30px;
        }
        a{
            text-decoration: none;
            color: #0b93d9;
        }

        /*login 结束*/
    </style>
</head>
<body>
<div class="login">
    <div class="login_title">
        <p>E-XPay聚合支付平台</p>
    </div>
    <div class="login_main">
        <div class="main_left"></div>
        <div class="main_right">
            <div class="right_title">用户登录</div>
            <form action="" class="layui-form" >
                <div class="username">
                    <img src="<%=basePath%>resources/images/username.png" alt="">
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="请输入用户名" value="admin">
                </div>
                <div class="password">
                    <img src="<%=basePath%>resources/images/password.png" alt="">
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="请输入密码" value="123456">
                </div>
                <div class="code">
                    <img src="<%=basePath%>resources/images/code.png" alt="">
                    <input type="text" placeholder="请输入验证码" name="vercode" id="LAY-user-login-vercode" lay-verify="required">
                    <div class="code_img">
                        <img src="<%=basePath%>captcha/getCaptchaCode.html" style="border-radius: 3px" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode">
                    </div>
                </div>
                <div class="yes_login">
                    <input type="hidden" value="${param.backUrl}" name="backUrl" id="backUrl">

                    <a href="javascript:void(0)" class="layui-btn layui-btn-fluid" lay-submit id="submit"  lay-filter="LAY-user-login-submit">登&nbsp;&nbsp;&nbsp;&nbsp;录</a>
                </div>
            </form>
        </div>
    </div>
    <div class="login_footer">
        <p class="name">© 2019 山东映湃数据科技有限公司 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鲁ICP 备17030613号-1</p>
    </div>
</div>
<script src="<%=basePath%>resources/lib/layuiAdmin/layui/layui.js"></script>
<script>

</script>

<script>
    layui.config({
        base: '<%=basePath%>resources/lib/layuiAdmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index',"form"], function(){
        var $ = layui.$
            ,form = layui.form
            ,router = layui.router();

        form.render();
        document.onkeyup = function (e) {
            var code = e.charCode || e.keyCode;
            if (code == 13) {
                $("#submit").click();
            }}
        $("#LAY-user-get-vercode").on("click",function () {
            $(this).attr("src", "<%=basePath%>captcha/getCaptchaCode.html");
        })

        //提交
        form.on('submit(LAY-user-login-submit)', function(obj){
            layer.msg('登陆中...', {icon: 16,shade: 0.01});
            $.ajax({
                url: "<%=basePath%>sso/login.html",
                type:"post",
                data:obj.field,
                dataType:"JSON",
                success:function (data) {
                    if (data.success){
                        layer.msg('登陆成功', {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        }, function(){
                            location.href = "<%=basePath%>manager/index.html"; //后台主页
                        });
                    }else {
                        layer.msg(data.message);
                    }



                }
            });

        });



    });
</script>
</body>
</html>
